﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Shipwire.Messages;

namespace Shipwire
{
    public interface IShipwireService
    {
        /// <summary>
        /// Retrives product information for all products across all warehouses.
        /// </summary>
        /// <returns></returns>
        InventoryUpdateResponse GetInventoryDetails();
        /// <summary>
        /// Retrives product information for specific product codes across all warehouses.
        /// </summary>
        /// <param name="productCode">Product codes to retrive data for.</param>
        /// <returns></returns>
        InventoryUpdateResponse GetInventoryDetails(params string[] productCode);
        /// <summary>
        /// Retrives product information for all products related to the specified warehouse.
        /// </summary>
        /// <param name="warehouse">Warehouse to retrive data for.</param>
        /// <returns></returns>
        InventoryUpdateResponse GetInventoryDetails(Warehouse warehouse);
        /// <summary>
        /// Retrives product information for specific product codes related to the specified warehouse.
        /// </summary>
        /// <param name="warehouse">Warehouse to retrive data for.</param>
        /// <param name="productCode">Product codes to retrive data for.</param>
        /// <returns></returns>
        InventoryUpdateResponse GetInventoryDetails(Warehouse warehouse, params string[] productCode);
        /// <summary>
        /// Retrives product information for a specific product query.
        /// </summary>
        /// <param name="country">Country to retrive data for.</param>
        /// <param name="warehouse">Warehouse to retrive data for.</param>
        /// <param name="includeEmpty">Should the query return items with no data.</param>
        /// <param name="productCode">Product codes to retrive data for.</param>
        /// <returns></returns>
        InventoryUpdateResponse GetInventoryDetails(WarehouseCountry? country, Warehouse? warehouse, bool includeEmpty, params string[] productCode);

        /// <summary>
        /// Retrives a list of shipping options for the specified order.
        /// </summary>
        /// <param name="order"></param>
        /// <returns></returns>
        RateResponse GetShippingEstimates(OrderRateRequest order);

        /// <summary>
        /// Places an order with shipwire, returning a Transaction ID for the batch of orders.
        /// </summary>
        /// <param name="orders"></param>
        FulfillmentResponse PlaceOrder(params FulfillmentOrder[] orders);

        /// <summary>
        /// Retrives all tracking information from your Shipwire account.
        /// </summary>
        TrackingResponse GetAllTrackingData();

        /// <summary>
        /// Retrives tracking information about orders with the supplied Order Id.
        /// <param name="orderNo">This is the Order No specified by the called when the order was created.</param>
        /// </summary>
        TrackingResponse TrackCustomerOrder(string orderNo);

        /// <summary>
        /// Retrives tracking information about orders with the supplied Shipwire Id.
        /// <param name="shipwireId">This is the Shipwire Id of the order, returned when the order was created.</param>
        /// </summary>
        TrackingResponse TrackShipwireOrder(string shipwireId);
    }
}
